"use strict";
global.projectRoot = __dirname;
const http = require("http");
const express = require("express");
const initSubsystem = require("./init_subsystem");
const initMiddleware = require("./init_middleware");
const initDb = require("./init_db").init;
const cfg = require("./config/server");

process.on("uncaughtException", e => console.error("发现未捕捉异常", e, e.stack));
require("./init_logger");
initDb();
const app = express();
initMiddleware(app);
initSubsystem(app);
http.createServer(app).listen(cfg.port, () => console.log("Namo Amitabha , 表单启动，监听端口", cfg.port));